# To change this template, choose Tools | Templates
# and open the template in the editor.

load 'InspectFile.rb'
load 'Markov.rb'

puts ARGV[0].to_s()

if ARGV.length != 2
  puts "Bad number of arguments"
  exit
end

if ARGV[0] && File.readable?(ARGV[1])
  fd = File.open(ARGV[1], 'r')
else
  puts "Missing input file"
  exit()
end

i = InspectFile.new
i.parse(fd)

m = Markov.new(i.n, i.mat)
if ARGV[0].to_i == 1
  print "Parcours : "
  m.go_through
elsif ARGV[0].to_i == 2
  m.conex(0)
  m.conex_full
else
  puts "Bad args"
end

